<template>
  <div>
    <van-field
      readonly
      clickable
      :label="good.title"
      :value="value"
      placeholder=""
      @click="showPicker = true"
      
    >
    
    </van-field>
    <van-popup v-model="showPicker" position="bottom">
      <van-picker
        show-toolbar
        :columns="good.text"
        @cancel="showPicker = false"
        @confirm="onConfirm"
        ref="getColumnIndex"
      >

      
      </van-picker>
      
    </van-popup>

    
  </div>
</template>

<script>
export default {
  data() {
    return {
      value: "",
      showPicker: false,
      arr:[],
    };
  },
  props:{
      good:Object, 
  },
  methods: {
    onConfirm(value) {
        this.value = value;
        this.showPicker = false;
        this.arr.push(this.$refs.getColumnIndex.$children[0].currentIndex)
        console.log(this.arr);
    },
  },
};
</script>

<style lang="less" scoped>
</style>